From 00f147a7a687d5772bcc538bc606cfff972178cd Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Thu, 12 Oct 2023 17:24:13 +0200 Subject: feat(components): add a Time component Instead of using helpers functions to format the date each time we need to use a time element, it makes more sense to create a new component dedicated to this task. --- src/pages/projets/[slug].tsx | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) (limited to 'src/pages/projets/[slug].tsx') diff --git a/src/pages/projets/[slug].tsx b/src/pages/projets/[slug].tsx index 6ef3df5..3d3c57e 100644 --- a/src/pages/projets/[slug].tsx +++ b/src/pages/projets/[slug].tsx @@ -24,12 +24,12 @@ import { Figure, type MetaItemData, type MetaValues, + Time, } from '../../components'; import styles from '../../styles/pages/project.module.scss'; import type { NextPageWithLayout, ProjectPreview, Repos } from '../../types'; import { ROUTES } from '../../utils/constants'; import { - getFormattedDate, getSchemaJson, getSinglePageSchema, getWebPageSchema, @@ -167,18 +167,6 @@ const ProjectPage: NextPageWithLayout = ({ project }) => { url: `${website.url}${asPath}`, }; - /** - * Retrieve a formatted date (and time). - * - * @param {string} date - A date string. - * @returns {JSX.Element} The formatted date wrapped in a time element. - */ - const getDate = (date: string): JSX.Element => { - const isoDate = new Date(`${date}`).toISOString(); - - return ; - }; - const headerMeta: (MetaItemData | undefined)[] = [ { id: 'publication-date', @@ -187,7 +175,7 @@ const ProjectPage: NextPageWithLayout = ({ project }) => { description: 'ProjectsPage: publication date label', id: 'HxZvY4', }), - value: getDate(dates.publication), + value: